package com.lwq.project.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lwq.project.dao.custom.CustomRoleMapper;
import com.lwq.project.model.Role;
import com.lwq.project.service.RoleService;

@Service
public class RoleServiceImpl implements RoleService {
	
	@Autowired
	private CustomRoleMapper customRoleMapper;
	
	public List<Role> getAllRole() {
		return customRoleMapper.getAllRole();
	}

	public List<Role> getPageRole(Map<String, Object> map) {
		return customRoleMapper.getPageRole(map);
	}

	public int countRole() {
		return customRoleMapper.countRole();
	}

	public int insertRole(Role role) {
		return customRoleMapper.insert(role);
	}

	public int updateRole(Role role) {
		return customRoleMapper.updateByPrimaryKeySelective(role);
	}

	public Role getRoleById(String rid) {
		return customRoleMapper.selectByPrimaryKey(rid);
	}


	public int deleteRolesById(String[] rIds) {
		return customRoleMapper.delRoles(rIds);
	}

	public Role getRoleByUid(String uId) {
		return customRoleMapper.getRoleByUid(uId);
	}

}
